#!/bin/bash

# Installation script for dependencies on Ubuntu/Debian systems

set -e

echo "Installing dependencies for Image to PCD Converter..."

# Update package list
sudo apt update

# Install build tools
echo "Installing build tools..."
sudo apt install -y build-essential cmake pkg-config

# Install PCL
echo "Installing PCL (Point Cloud Library)..."
sudo apt install -y libpcl-dev

# Install OpenCV
echo "Installing OpenCV..."
sudo apt install -y libopencv-dev

# Install Eigen3
echo "Installing Eigen3..."
sudo apt install -y libeigen3-dev

# Install yaml-cpp
echo "Installing yaml-cpp..."
sudo apt install -y libyaml-cpp-dev

# Install VTK (for PCL visualization)
echo "Installing VTK..."
sudo apt install -y libvtk7-dev || sudo apt install -y libvtk9-dev

# Optional: Install additional useful tools
echo "Installing additional tools..."
sudo apt install -y git

echo "All dependencies installed successfully!"
echo "You can now build the project using: ./scripts/build.sh"
